A data transfer device has been known to which a master device that issues a plurality of transfer requests and a plurality of slave devices that output response signals in response to the transfer requests are connected (for example, Unexamined Japanese Patent Application Kokai Publication No. 2007-249668). This data transfer device counts up on a counter for each slave device when a response signal from the slave device is inputted, and counts down on the counter when a data transfer completion signal is inputted. In this data transfer device, data can be transferred between a slave device selected on the basis of the plurality of transfer request counters and the master device.
Nowadays, a network composed of a plurality of relay devices is often used. The use of a plurality of relay devices brings about the increase in the number of times of relaying data, and thus increasing the communication costs. However, in the art described in Unexamined Japanese Patent Application Kokai Publication No. 2007-249668, the problem of communication cost increase due to the increase of the number of times of relaying data like messages is not fully considered.
The present invention was made in view of such a problem and has an objective of providing a communication system and a relay device, a computer-readable recording medium that has recorded a relay program, and a communication method and relay method, all of which will be able to curb an increase of communication costs even if the number of times of relaying data like messages increases.